package com.lagou.service.impl;

import com.lagou.service.MethodService;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;

@Service
public class MethodServiceImpl implements MethodService {
    @Override
    public String methodA(String name, int timeTowait) {
        int random = new Random().nextInt(timeTowait);
        try {
            Thread.sleep(random);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodA: "+name;
    }

    @Override
    public String methodB(String name, int timeTowait) {
        int random = new Random().nextInt(timeTowait);
        try {
            Thread.sleep(random);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodB: "+name;
    }

    @Override
    public String methodC(String name, int timeTowait) {
        int random = new Random().nextInt(timeTowait);
        try {
            Thread.sleep(random);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodC: "+name;
    }
}
